<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">

<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta content="IE=edge" http-equiv="X-UA-Compatible">
    <link rel="icon" sizes="any" mask="" href="../static/img/boxicon.png">


    <title>Depot仓储管理系统 | 修改订单</title>
    <meta content="Depot仓储管理系统 修改订单" name="description">
    <meta content="Depot仓储管理系统 修改订单" name="keywords">


    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.6 -->
    <!-- Font Awesome -->
    <!-- Ionicons -->
    <!-- iCheck -->
    <!-- Morris chart -->
    <!-- jvectormap -->
    <!-- Date Picker -->
    <!-- Daterange picker -->
    <!-- Bootstrap time Picker -->
    <!--<link rel="stylesheet" href="../static/plugins/timepicker/bootstrap-timepicker.min.css">-->
    <!-- bootstrap wysihtml5 - text editor -->
    <!--数据表格-->
    <!-- 表格树 -->
    <!-- select2 -->
    <!-- Bootstrap Color Picker -->
    <!-- bootstrap wysihtml5 - text editor -->
    <!--bootstrap-markdown-->
    <!-- Theme style -->
    <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
    <!-- Ion Slider -->
    <!-- ion slider Nice -->
    <!-- bootstrap slider -->
    <!-- bootstrap-datetimepicker -->

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

    <script src="https://cdn.bootcdn.net/ajax/libs/blueimp-md5/2.18.0/js/md5.js"></script>
    <!-- jQuery 2.2.3 -->
    <!-- jQuery UI 1.11.4 -->
    <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
    <!-- Bootstrap 3.3.6 -->
    <!-- Morris.js charts -->
    <!-- Sparkline -->
    <!-- jvectormap -->
    <!-- jQuery Knob Chart -->
    <!-- daterangepicker -->
    <!-- datepicker -->
    <!-- Bootstrap WYSIHTML5 -->
    <!-- Slimscroll -->
    <!-- FastClick -->
    <!-- iCheck -->
    <!-- AdminLTE App -->
    <!-- 表格树 -->
    <!-- select2 -->
    <!-- bootstrap color picker -->
    <!-- bootstrap time picker -->
    <!--<script src="../static/plugins/timepicker/bootstrap-timepicker.min.js"></script>-->
    <!-- Bootstrap WYSIHTML5 -->
    <!--bootstrap-markdown-->
    <!-- CK Editor -->
    <!-- InputMask -->
    <!-- DataTables -->
    <!-- ChartJS 1.0.1 -->
    <!-- FLOT CHARTS -->
    <!-- FLOT RESIZE PLUGIN - allows the chart to redraw when the window is resized -->
    <!-- FLOT PIE PLUGIN - also used to draw donut charts -->
    <!-- FLOT CATEGORIES PLUGIN - Used to draw bar charts -->
    <!-- jQuery Knob -->
    <!-- Sparkline -->
    <!-- Morris.js charts -->
    <!-- Ion Slider -->
    <!-- Bootstrap slider -->
    <!-- bootstrap-datetimepicker -->
    <!-- 页面meta /-->
    <link href="../static/plugins/video/video.css" rel="stylesheet" type="text/css">
    <link href="../static/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="../static/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <link href="../static/plugins/ionicons/css/ionicons.min.css" rel="stylesheet">
    <link href="../static/plugins/iCheck/square/blue.css" rel="stylesheet">
    <link href="../static/plugins/morris/morris.css" rel="stylesheet">
    <link href="../static/plugins/jvectormap/jquery-jvectormap-1.2.2.css" rel="stylesheet">
    <link href="../static/plugins/datepicker/datepicker3.css" rel="stylesheet">
    <link href="../static/plugins/daterangepicker/daterangepicker.css" rel="stylesheet">
    <link href="../static/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css" rel="stylesheet">
    <link href="../static/plugins/datatables/dataTables.bootstrap.css" rel="stylesheet">
    <link href="../static/plugins/treeTable/jquery.treetable.css" rel="stylesheet">
    <link href="../static/plugins/treeTable/jquery.treetable.theme.default.css" rel="stylesheet">
    <link href="../static/plugins/select2/select2.css" rel="stylesheet">
    <link href="../static/plugins/colorpicker/bootstrap-colorpicker.min.css" rel="stylesheet">
    <link href="../static/plugins/bootstrap-markdown/css/bootstrap-markdown.min.css" rel="stylesheet">
    <link href="../static/plugins/adminLTE/css/AdminLTE.css" rel="stylesheet">
    <link href="../static/plugins/adminLTE/css/skins/_all-skins.min.css" rel="stylesheet">
    <link href="../static/css/style.css" rel="stylesheet">
    <link href="../static/plugins/ionslider/ion.rangeSlider.css" rel="stylesheet">
    <link href="../static/plugins/ionslider/ion.rangeSlider.skinNice.css" rel="stylesheet">
    <link href="../static/plugins/bootstrap-slider/slider.css" rel="stylesheet">
    <link href="../static/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.css" rel="stylesheet">
</head>

<body class="hold-transition skin-purple sidebar-mini">

<div class="wrapper">

    <!-- 页面头部 -->
    <header class="main-header">


        <!-- Logo -->
        <a class="logo" href="/index/frontData">
            <!-- mini logo for sidebar mini 50x50 pixels -->
            <span class="logo-mini"><b>仓储</b></span>
            <!-- logo for regular state and mobile devices -->
            <span class="logo-lg"><b>Depot仓储</b>管理系统</span>
        </a>


        <!-- Header Navbar: style can be found in header.less -->
        <nav class="navbar navbar-static-top">
            <!-- Sidebar toggle button-->
            <a class="sidebar-toggle" data-toggle="offcanvas" href="#" role="button">
                <span class="sr-only">Toggle navigation</span>
            </a>

            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <!-- User Account: style can be found in dropdown.less -->
                    <li class="dropdown user user-menu">
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                            <img alt="User Image" class="user-image" src="../static/img/user2-160x160.jpg">
                            <span class="hidden-xs" th:text="${session.user.username}">用户名</span>
                        </a>
                        <ul class="dropdown-menu">
                            <!-- User image -->
                            <li class="user-header">
                                <img alt="User Image" class="img-circle" src="../static/img/user2-160x160.jpg">

                                <p th:text="${session.user.username}">用户名</p>
                                <div style="color:#ffffff"><small>登陆时间：</small> <small th:text="${session.loginTime}">登陆时间</small>
                                </div>

                            </li>
                            <!-- Menu Body
                    <li class="user-body">
                        <div class="row">
                            <div class="col-xs-4 text-center">
                                <a href="#">Followers</a>
                            </div>
                            <div class="col-xs-4 text-center">
                                <a href="#">Sales</a>
                            </div>
                            <div class="col-xs-4 text-center">
                                <a href="#">Friends</a>
                            </div>
                        </div>
                    </li>-->
                            <!-- Menu Footer-->
                            <li class="user-footer">
                                <div class="pull-left">
                                    <a class="btn btn-default btn-flat" href="/user/changePasswordPage">修改密码</a>
                                </div>
                                <div class="pull-right">
                                    <a class="btn btn-default btn-flat" href="/user/logout">注销</a>
                                </div>
                            </li>
                        </ul>
                    </li>

                </ul>
            </div>
        </nav>
    </header>
    <!-- 页面头部 /-->

    <!-- 导航侧栏 -->
    <aside class="main-sidebar">
        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">
            <!-- Sidebar user panel -->
            <div class="user-panel">
                <div class="pull-left image">
                    <img alt="User Image" class="img-circle" src="../static/img/user2-160x160.jpg">
                </div>
                <div class="pull-left info">
                    <p th:text="${session.user.username}">用户名</p>
                    <a href="#"><i class="fa fa-circle text-success"
                                   th:text="'实例：'+${session.user.instanceId}+'&nbsp;&nbsp;'"></i>已登录</a>
                </div>
            </div>
            <!-- search form -->
            <!--<form action="#" method="get" class="sidebar-form">
        <div class="input-group">
            <input type="text" name="q" class="form-control" placeholder="搜索...">
            <span class="input-group-btn">
            <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
            </button>
          </span>
        </div>
    </form>-->
            <!-- /.search form -->


            <!-- sidebar menu: : style can be found in sidebar.less -->
            <ul class="sidebar-menu">
                <li class="header">菜单</li>

                <li id="admin-index"><a href="/index/frontData"><i class="fa fa-dashboard"></i> <span>首页</span></a>
                </li>

                <!-- 菜单 -->


                <li class="treeview">
                    <a href="#">
                        <i class="fa fa-archive"></i> <span>商品管理</span>
                        <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                    </a>
                    <ul class="treeview-menu">

                        <li id="product-data">
                            <a href="/product/productData">
                                <i class="fa fa-circle-o"></i> 商品详情
                            </a>
                        </li>

                        <li id="product-add">
                            <a href="/product/addProductPage">
                                <i class="fa fa-circle-o"></i> 添加商品
                            </a>
                        </li>
                    </ul>
                </li>

                <li class="treeview">
                    <a href="#">
                        <i class="fa fa-calendar-minus-o"></i> <span>订单管理</span>
                        <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                    </a>
                    <ul class="treeview-menu">

                        <li id="order-data">
                            <a href="/order/orderData">
                                <i class="fa fa-circle-o"></i> 订单详情
                            </a>
                        </li>

                        <li id="order-add">
                            <a href="/order/addOrderPage">
                                <i class="fa fa-circle-o"></i> 添加订单
                            </a>
                        </li>

                        <li id="order-pending">
                            <a href="/order/pendingOrderPage">
                                <i class="fa fa-circle-o"></i> 待处理订单
                            </a>
                        </li>

                        <li id="order-picking">
                            <a href="/order/myPickingOrderPage">
                                <i class="fa fa-circle-o"></i> 我的拣货中订单
                            </a>
                        </li>

                        <li id="order-wait-deliver">
                            <a href="/order/myWaitDeliverOrderPage">
                                <i class="fa fa-circle-o"></i> 我的待发货订单
                            </a>
                        </li>
                    </ul>
                </li>

                <li class="treeview">
                    <a href="#">
                        <i class="fa fa-university"></i> <span>货架管理</span>
                        <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                    </a>
                    <ul class="treeview-menu">

                        <li id="rack-data">
                            <a href="/rack/rackData">
                                <i class="fa fa-circle-o"></i> 货架详情
                            </a>
                        </li>

                        <li id="rack-add">
                            <a href="/rack/addRackPage">
                                <i class="fa fa-circle-o"></i> 添加货架
                            </a>
                        </li>
                    </ul>
                </li>

                <li class="treeview">
                    <a href="#">
                        <i class="fa fa-table"></i> <span>出入库记录管理</span>
                        <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                    </a>
                    <ul class="treeview-menu">

                        <li id="io-data">
                            <a href="/io/ioData">
                                <i class="fa fa-circle-o"></i> 出入库记录详情
                            </a>
                        </li>

                        <li id="io-add">
                            <a href="/io/addIoPage">
                                <i class="fa fa-circle-o"></i> 添加出入库记录
                            </a>
                        </li>
                    </ul>
                </li>

                <li class="treeview">
                    <a href="#">
                        <i class="fa fa-globe"></i> <span>供应商管理</span>
                        <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                    </a>
                    <ul class="treeview-menu">

                        <li id="vendors-data">
                            <a href="/vendors/vendorsData">
                                <i class="fa fa-circle-o"></i> 供应商详情
                            </a>
                        </li>

                        <li id="vendors-add">
                            <a href="/vendors/addVendorsPage">
                                <i class="fa fa-circle-o"></i> 添加供应商
                            </a>
                        </li>
                    </ul>
                </li>

                <li class="treeview">
                    <a href="#">
                        <i class="fa fa-user"></i> <span>用户管理</span>
                        <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                    </a>
                    <ul class="treeview-menu">

                        <li id="user-data">
                            <a href="/user/userData">
                                <i class="fa fa-circle-o"></i> 用户详情
                            </a>
                        </li>

                        <li id="user-add">
                            <a href="/user/addUserPage">
                                <i class="fa fa-circle-o"></i> 添加用户
                            </a>
                        </li>
                    </ul>
                </li>

                <li id="analysis"><a href="/analysis/analysisPage"><i class="fa fa-pie-chart"></i> <span>数据分析</span></a>
                </li>


                <!-- 菜单 /-->

            </ul>
        </section>
        <!-- /.sidebar -->
    </aside>
    <!-- 导航侧栏 /-->

    <!-- 内容区域 -->
    <div class="content-wrapper">

        <!-- 内容头部 -->
        <section class="content-header">
            <h1>
                订单管理
                <small>管理您的订单</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-calendar-minus-o"></i> 订单管理</a></li>
                <li><a href="#"> 订单详情</a></li>
                <li class="active">修改订单</li>
            </ol>
        </section>
        <!-- 内容头部 /-->

        <!-- 正文区域 -->
        <section class="content">
            <!-- 修改密码 -->
            <div class="box box-primary">
                <div class="box-header with-border">
                    <h3 class="box-title">修改订单</h3>
                    <a th:href="'/order/content?orderId='+${order.getId()}">
                        <button type="button" class="btn btn-success pull-right">查看订单中的商品</button>
                    </a>
                </div>
                <!-- /.box-header -->
                <!-- form start -->
                <form role="form">
                    <div class="box-body">
                        <div class="form-group">
                            <label for="orderId">订单Id</label>
                            <input type="text" class="form-control" id="orderId" placeholder="订单Id" th:value="${order.getId()}" data-cip-id="orderId" disabled>
                        </div>
                        <div class="form-group">
                            <label for="orderTime">下单时间</label>
                            <input type="text" class="form-control" id="orderTime" placeholder="下单时间" th:value="${order.getOrderTime()}" data-cip-id="orderTime" disabled>
                        </div>
                        <div class="form-group">
                            <label for="sendTime">寄出时间</label>
                            <input type="text" class="form-control" id="sendTime" placeholder="寄出时间" th:value="${order.getSendTime()}" data-cip-id="sendTime">
                        </div>
                        <div class="form-group">
                            <label for="orderUser">下单者名称</label>
                            <input type="text" class="form-control" id="orderUser" placeholder="下单者名称" th:value="${order.getOrderUser()}" data-cip-id="orderUser">
                        </div>
                        <div class="form-group">
                            <label for="orderLocation">收货地址</label>
                            <input type="text" class="form-control" id="orderLocation" placeholder="收货地址" th:value="${order.getOrderLocation()}" data-cip-id="orderLocation">
                        </div>
                        <div class="form-group">
                            <label for="orderPhone">下单者联系电话</label>
                            <input type="text" class="form-control" id="orderPhone" placeholder="下单者联系电话" th:value="${order.getOrderPhone()}" data-cip-id="orderPhone">
                        </div>
                        <div class="form-group">
                            <label for="price">总价</label>
                            <input type="number" class="form-control" id="price" placeholder="总价" th:value="${order.getPrice()}" data-cip-id="price" disabled>
                        </div>
                        <div class="form-group">
                            <label for="stats">订单状态</label>
                            <select class="form-control js-example-basic-single" data-cip-id="stats" id="stats"
                                    th:value="${order.getStats()}">
                                <option th:selected="${order.getStats() eq 0}" value="0">待处理</option>
                                <option th:selected="${order.getStats() eq 1}" value="1">拣货中</option>
                                <option th:selected="${order.getStats() eq 2}" value="2">待发货</option>
                                <option th:selected="${order.getStats() eq 3}" value="3">已发货</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="operator">拣货员Id</label>
                            <input type="number" class="form-control" id="operator" placeholder="拣货员Id" th:value="${order.getOperator()}" data-cip-id="operator">
                        </div>
                        <div>
                            <p class="alert alert-danger hidden" id="message">message</p>
                        </div>
                    </div>
                    <!-- /.box-body -->
                    <div class="box-footer">
                        <button type="button" class="btn btn-primary" onclick="change()">提交修改</button>
                    </div>
                </form>
            </div>
            <!-- /.row -->
        </section>
        <!-- 正文区域 /-->

    </div>
    <!-- 内容区域 /-->

    <!-- 底部导航 -->
    <footer class="main-footer">
        <div class="pull-right hidden-xs">
            <b>Version</b> 1.0.0
        </div>
        <strong>Copyright &copy; 2020-2021 <a href="http://vps.e1xp.top:8080">E1xP</a>.</strong> All rights reserved.
    </footer>
    <!-- 底部导航 /-->

</div>


<script src="../static/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script src="../static/plugins/jQueryUI/jquery-ui.min.js"></script>
<script>
    $.widget.bridge('uibutton', $.ui.button);
</script>
<script src="../static/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="../static/plugins/raphael/raphael-min.js"></script>
<script src="../static/plugins/morris/morris.min.js"></script>
<script src="../static/plugins/sparkline/jquery.sparkline.min.js"></script>
<script src="../static/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script src="../static/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<script src="../static/plugins/knob/jquery.knob.js"></script>
<script src="../static/plugins/daterangepicker/moment.min.js"></script>
<script src="../static/plugins/daterangepicker/daterangepicker.js"></script>
<script src="../static/plugins/daterangepicker/daterangepicker.zh-CN.js"></script>
<script src="../static/plugins/datepicker/bootstrap-datepicker.js"></script>
<script src="../static/plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>
<script src="../static/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<script src="../static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
<script src="../static/plugins/fastclick/fastclick.js"></script>
<script src="../static/plugins/iCheck/icheck.min.js"></script>
<script src="../static/plugins/adminLTE/js/app.min.js"></script>
<script src="../static/plugins/treeTable/jquery.treetable.js"></script>
<script src="../static/plugins/select2/select2.full.min.js"></script>
<script src="../static/plugins/colorpicker/bootstrap-colorpicker.min.js"></script>
<script src="../static/plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.zh-CN.js"></script>
<script src="../static/plugins/bootstrap-markdown/js/bootstrap-markdown.js"></script>
<script src="../static/plugins/bootstrap-markdown/locale/bootstrap-markdown.zh.js"></script>
<script src="../static/plugins/bootstrap-markdown/js/markdown.js"></script>
<script src="../static/plugins/bootstrap-markdown/js/to-markdown.js"></script>
<script src="../static/plugins/ckeditor/ckeditor.js"></script>
<script src="../static/plugins/input-mask/jquery.inputmask.js"></script>
<script src="../static/plugins/input-mask/jquery.inputmask.date.extensions.js"></script>
<script src="../static/plugins/input-mask/jquery.inputmask.extensions.js"></script>
<script src="../static/plugins/datatables/jquery.dataTables.min.js"></script>
<script src="../static/plugins/datatables/dataTables.bootstrap.min.js"></script>
<script src="../static/plugins/chartjs/Chart.min.js"></script>
<script src="../static/plugins/flot/jquery.flot.min.js"></script>
<script src="../static/plugins/flot/jquery.flot.resize.min.js"></script>
<script src="../static/plugins/flot/jquery.flot.pie.min.js"></script>
<script src="../static/plugins/flot/jquery.flot.categories.min.js"></script>
<script src="../static/plugins/ionslider/ion.rangeSlider.min.js"></script>
<script src="../static/plugins/bootstrap-slider/bootstrap-slider.js"></script>
<script src="../static/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.js"></script>
<script src="../static/plugins/bootstrap-datetimepicker/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script charset="UTF-8" src="../static/plugins/video/pingzi_video.js" type="text/javascript"></script>
<script>
    $(document).ready(function () {
        // 选择框
        $(".select2").select2();

        // WYSIHTML5编辑器
        $(".textarea").wysihtml5({
            locale: 'zh-CN'
        });
    });


    // 设置激活菜单
    function setSidebarActive(tagUri) {
        var liObj = $("#" + tagUri);
        if (liObj.length > 0) {
            liObj.parent().parent().addClass("active");
            liObj.addClass("active");
        }
    }


    $(document).ready(function () {
        // 激活导航位置
        setSidebarActive("change-order");
    });

    var orderId= document.getElementById("orderId");
    var sendTime= document.getElementById("sendTime");
    var orderUser= document.getElementById("orderUser");
    var orderLocation= document.getElementById("orderLocation");
    var orderPhone=document.getElementById("orderPhone");
    var stats=document.getElementById("stats");
    var operator=document.getElementById("operator");

    let message = document.getElementById("message");

    function change(){
        if (orderUser.value === "" || orderLocation.value === "" || orderPhone.value === "" || stats.value === "") {
            //输入有空值
            message.innerText = "下单者名称、收货地址、下单者联系电话、状态码不能为空！";
            message.setAttribute("class", "alert alert-danger");
        } else if (stats.value < 0 || stats.value > 3) {
            message.innerText = "状态码只能在0~3间！";
            message.setAttribute("class", "alert alert-danger");
        } else {
            message.setAttribute("class", "alert alert-danger hidden");
            $.ajax({
                url: "/order/update",
                type: "post",
                data: {
                    "id": orderId.value,
                    "sendTime": sendTime.value,
                    "orderUser": orderUser.value,
                    "orderLocation": orderLocation.value,
                    "orderPhone": orderPhone.value,
                    "stats": stats.value,
                    "operator": operator.value
                },
                success: function (msg) {
                    switch (msg['status']) {
                        case 200:
                            window.location.href = '/order/orderData';
                            break;
                        default:
                            message.innerText = msg['error'];
                            message.setAttribute("class", "alert alert-danger");
                            break;
                    }
                },
            });
        }
    }
</script>
</body>

</html>